package Day03;

import java.util.*;

/**
 * Creat with IntelliJ IDEA
 * Description
 * User: mamba24
 * Date: 2022-09-07
 * Time: 17:29
 * To BE A Better Person-2020-3-2
 */

public class TestDem01 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String s=sc.next();
        HashMap<String,Integer> map=new HashMap<>();
        int beg=0;
        for (int i = 0; i < s.length(); i++) {
            if(s.charAt(i)-s.charAt(i-1)>40){
                map.put(s.substring(beg,i),s.substring(beg,i).length());
                beg=i;
            }
        }
        List<Map.Entry<String,Integer>> list=new ArrayList<>(map.entrySet());
        Collections.sort(list,(o1,o2)->(o2.getValue()- o1.getValue()));
        System.out.println(list.get(0));
    }
}
